﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucNewItem.ascx.cs" Inherits="Admin_ucControl_ucNewItem" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
    TagPrefix="cc1" %>
    <style type="text/css">
        .th
        {
            color: Black;
        }
</style>
<h1>
    Danh Mục Ứng Dụng Con&nbsp;&nbsp;&nbsp;
</h1>
<br />
<div>
    <asp:HyperLink ID="hyp" runat="server" NavigateUrl="~/Admin/DanhSachSanPham.aspx" Font-Size="Medium">Quay lại</asp:HyperLink>
</div>
<br />
<asp:Panel ID="Panel1" runat="server" ForeColor="#FF3300">
    <table class="th">
        <tr>
            <td valign="top" style="width: 50%; float: left">
                <table style="width: 100%" >
                    <tr>
                        <th style="width: 100px">
                            Mã sản phẩm
                        </th>
                        <td>
                            <asp:TextBox ID="txtMaSP" runat="server" CssClass="inp-form"></asp:TextBox>
                            &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtMaSP"
                                Text="*" Font-Bold="True" ForeColor="Red" ValidationGroup="save"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th style="width: 100px">
                            Tên sản phẩm
                        </th>
                        <td>
                            <asp:TextBox ID="txtItemName" runat="server" CssClass="inp-form"></asp:TextBox>
                            &nbsp;<asp:RequiredFieldValidator ID="reqCatename" runat="server" ControlToValidate="txtItemName"
                                Text="*" Font-Bold="True" ForeColor="Red" ValidationGroup="save"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Thuộc loại ứng dụng
                        </th>
                        <td>
                            <asp:DropDownList ID="drMenuChild" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Thuộc nhà cung cấp
                        </th>
                        <td>
                            <asp:DropDownList ID="drSuppliers" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Mô tả sản phẩm
                        </th>
                        <td>
                            <%--<cc1:Editor ID="txtDescription" runat="server" />--%>
                            <cc1:Editor ID="txtDescription" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Tính năng
                        </th>
                        <td>
                            <%--<cc1:Editor ID="txtDescription" runat="server" />--%>
                            <cc1:Editor ID="txtFeatures" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Thông số kỹ thuật
                        </th>
                        <td>
                            <%--<cc1:Editor ID="txtDescription" runat="server" />--%>
                            <cc1:Editor ID="txtSpecification" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Đơn giá
                        </td>
                        <td>
                            <asp:TextBox ID="txtPrice" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="btAdd" runat="server" Text="Save" OnClick="btAdd_Click" ValidationGroup="save"
                                Height="26px" />
                            <asp:Button ID="btnReset" runat="server" Text="Reset" />
                        </td>
                    </tr>
                </table>
            </td>
            <td valign="top" style="float: right; padding-left: 20px">
                <div>
                    <table style="width: 100%">
                        <tr>
                            <td colspan="2">
                                <b>Cập nhật hình ảnh </b>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Đường Dẫn Hình
                            </td>
                            <td>
                                <asp:FileUpload ID="upImage" runat="server" />
                                <asp:Label ID="lbMessage" runat="server" Text="Label" ForeColor="Black"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="btnAddImage" runat="server" Text="Upload" 
                                    Height="26px" onclick="btnAddImage_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div>
                    <asp:GridView ID="grdImgItems" runat="server" AutoGenerateColumns="False" EmptyDataText="No images found"
                        OnRowDataBound="grdImgItems_RowDataBound" Width="500px">
                        <Columns>
                            <asp:ImageField DataImageUrlField="ImageURL" DataImageUrlFormatString="~/Admin/Images/Items/{0}"
                                HeaderText="Image">
                                <ControlStyle Height="80px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:ImageField>
                            <asp:TemplateField HeaderText="Default">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkDefault" runat="server" Enabled="false" />
                                    &nbsp;
                                    <asp:ImageButton ID="btnDefault" runat="server" ImageUrl="~/Admin/images/table/btnDefault.jpg" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Delete">
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnDelImg" runat="server" CausesValidation="false" CommandArgument='<%# Eval("ID") %>'
                                        CommandName="delete" ImageUrl="~/Admin/images/table/del.gif" OnClick="btnDelImg_Click" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
                        <EmptyDataTemplate>
                            No images found
                        </EmptyDataTemplate>
                        <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                        <HeaderStyle BackColor="Tan" Font-Bold="True" Height="30px" />
                        <AlternatingRowStyle BackColor="PaleGoldenrod" />
                    </asp:GridView>
                </div>
            </td>
        </tr>
    </table>
</asp:Panel>
